package com.initialize.common.tool.redis;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.Jedis;

/**
 * Created with IntelliJ IDEA.
 * User: jane
 * Date: 2019/12/16
 * Time: 下午5:06
 * Description: 这是迷你版本的Redis的配置类,因为这是自己封装的
 * 只能满足一些基本的使用
 */
@Slf4j
@Data
@Configuration
@ConfigurationProperties(prefix = "mini-redis")
public class MiniRedisConfig {

    private String password;

    private String host;


    @Bean
    public Jedis createJedis() {
        Jedis jedis = new Jedis(host);
        jedis.auth(password);
        return jedis;
    }

}